﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GmFamilyUtils.h"
#include "ElementId.h"
#include <vector>
#include <map>
#include <unordered_map>

namespace gcmp
{
    class IDocument;
    class IElement;
}

namespace gfam
{
    /// \brief 拷贝操作的工具类
    class GM_FAMILY_UTILS_EXPORT FamilyCopyUtils
    {
    public:
        /// \brief 跨文档拷贝Elements
        /// 
        /// \param pDocFrom [in] 源文档
        /// \param pDocTo [in] 目标文档
        /// \param modelViewId [in] 当前视图id
        /// \param sourceElementIds [in] 需要拷贝对象的id
        /// \param newToOldIdMap [out] 新老id映射关系
        /// \return 拷贝后对象的ids
        static std::vector<gcmp::ElementId> CopyElements(const gcmp::IDocument* pDocFrom, 
            gcmp::IDocument* pDocTo, 
            gcmp::ElementId modelViewId, 
            const std::vector<gcmp::ElementId>& sourceElementIds, 
            std::unordered_map<gcmp::ElementId, gcmp::ElementId, gcmp::ElementIdHash>& newToOldIdMap);

    };
}

